package com.homelock.constants;

/**
 * 0x00 未知用户
 * 0x01 指纹用户
 * 0x02 密码用户
 * 0x03 IC用户
 * 0x04 钥匙用户
 * 0x05 手机用户
 * 0x06 遥控用户
 * 0x07 临时用户
 */
public enum  ZxUserTypeEnum {
    UNDEFINED_USER(0x00 ,"未知用户","未知用户开门"),
    FINGER_USER(0x01,"指纹用户","指纹开门"),
    PWD_USER(0x02,"密码用户","密码开门"),
    IC_USER(0x03,"IC用户","IC卡开门"),
    KEY_USER(0x04,"钥匙用户","钥匙开门"),
    PHONE_USER(0x05,"手机用户","手机开门"),
    REMOTE_USER(0x06,"遥控用户","遥控开门"),
    TMP_USER(0x07,"临时用户","临时用户开门");

    int code;
    String desc;
    String typeName;

    ZxUserTypeEnum(int code, String desc,String typeName) {
        this.code = code;
        this.desc = desc;
        this.typeName = typeName;
    }

    public static ZxUserTypeEnum codeValue(byte code){
        for(ZxUserTypeEnum zxUserTypeEnum:values()){
            if(zxUserTypeEnum.getCode() == code){
                return zxUserTypeEnum;
            }
        }
        return null;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getTypeName() {
      return this.typeName;
    }
}
